package com.by.common.conf;

import java.io.InputStreamReader;
import java.util.Properties;

public class TelConfMager {

	private static Properties prop = new Properties();

	static {
		try {
			prop.load(new InputStreamReader(
					TelConfMager.class.getClassLoader().getResourceAsStream("conf/myphone.properties"), "UTF-8"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static String getProperty(String key) {
		return prop.getProperty(key);
	}

	public static Integer getInteger(String key) {
		String val = getProperty(key);
		try {
			return Integer.valueOf(val);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return 0;
	}

	public static Boolean getBoolean(String key) {
		String val = getProperty(key);
		try {
			return Boolean.valueOf(val);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}

	public static Long getLong(String key) {
		String val = getProperty(key);
		try {
			return Long.valueOf(val);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return 0L;
	}
}
